import React, { useState } from'react';
import { Swiper,SwiperItem,View,Input,Image } from '@tarojs/components';
import BottomNavigation from '../../components/BottomNavigation/BottomNavigation';
import './index.scss';

import Taro from "@tarojs/taro";
// 轮播
const MySwiper = ({ images }: { images: string[] }) => (
  <Swiper
    indicatorDots
    autoplay
    interval={3000}
    circular
  >
    {images.map((src, index) => (
      <SwiperItem key={index}>
        <Image src={src} mode="aspectFill" style={{ width: '100%' , height: '100%' }}  />
      </SwiperItem>
    ))}
  </Swiper>
);
const Index: React.FC = () => {
  const [selectedIndex, setSelectedIndex] = useState(0);
  const imageList = [
    'https://img03.k3cdn.com/k/1017390/2025042220079091180444w800h800_750x750.jpg',
    'https://img03.k3cdn.com/k/1017390/2025042220079091180444w800h800_750x750.jpg',
    'https://img03.k3cdn.com/k/1017390/2025042220079091180444w800h800_750x750.jpg',
    'https://img03.k3cdn.com/k/1017390/2025042220079091180444w800h800_750x750.jpg'
  ];
  const handleGo = (path: string) => {
    Taro.navigateTo({
      url: path,
    });
  };
  return (
    <View className="plus-page">
      <View className="plus-content">
        <View className="plus-swiper">
          <MySwiper images={imageList} />
        </View>
        <View className="skip">
          <View className="authenticate-box">
            <View className="online" onClick={() => handleGo('/pages/plus/online-appraisal/index')}>
              <View className="title">在线鉴定</View>
              <View className="dsc">ZAIXIANJIANDING</View>
              <View className="jump">
                <Image className="photo" src={require(`../../assets/plus/online.png`)}/>
                <Image className="icon" src={require(`../../assets/icons/plus-fill.png`)}/>
              </View>
            </View>
            <View className="online" onClick={() => handleGo('/pages/plus/entity-appraisal/index')}>
              <View className="title">实物鉴定</View>
              <View className="dsc">SHIWUJIANDING</View>
              <View className="jump">
                <Image className="photo" src={require(`../../assets/plus/kind.png`)}/>
                <Image className="icon" src={require(`../../assets/icons/plus-fill.png`)}/>
              </View>
            </View>
          </View>

          <View className="up-article" onClick={() => handleGo('/pages/plus/sell-text/index')}>
            <View className="up-type">
              <View className="title">发图文</View>
              <View className="dsc">FATUWEN</View>
            </View>
            <View className="up-jump">
              <Image className="photo" src={require(`../../assets/plus/text.png`)}/>
            </View>
            <View className="up-icon">
              <Image className="icon" src={require(`../../assets/icons/plus-fill.png`)}/>
            </View>
          </View>
          <View className="up-article" onClick={() => handleGo('/pages/plus/sell-video/index')}>
            <View className="up-type">
              <View className="title">发视频</View>
              <View className="dsc">FASHIPING</View>
            </View>
            <View className="up-jump">
              <Image className="photo" src={require(`../../assets/plus/text.png`)}/>
            </View>
            <View className="up-icon">
              <Image className="icon" src={require(`../../assets/icons/plus-fill.png`)}/>
            </View>
          </View>
        </View>

      </View>
      <BottomNavigation selectedIndex={selectedIndex} onTabChange={setSelectedIndex} />
    </View>
  );
};

export default Index;
